﻿<%@ Page Language="C#" MasterPageFile="~/Templates/Member.master" AutoEventWireup="true" CodeFile="Member-Address.aspx.cs" Inherits="Member_Address" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <div style="height:500px;width:100%;">
        <div style="width:100%; background-color:#F3F8FE; height:25px; color:#014D7F; padding-top:5px;">&nbsp; &nbsp;收货地址</div>
        <div>
            <div id="divContent" style="margin-left:5px; margin-top:10px; font-weight:normal; font-size:12px;">
                <hr />
                <input type="button" value="新 增" class="short-btn" onclick="window.location.href='Member-Address-edit.aspx';" />
               <hr />
                <div style=" color:#FF6600;">已保存的收货地址</div>
                <table width="100%" style="border:solid 1px #A2CBFF;">
                    <tr style="" class="addressHeader">
                        <td align="center" style="width:60px;" >收货人</td>
                        <td align="center" style="width:150px;">所在地区</td>
                        <td align="center">街道地址</td>
                        <td align="center" style="width:40px;">邮编</td>
                        <td align="center" style="width:70px;">电话</td>
                        <td align="center" style="width:70px;">手机</td>
                        <td style="width:70px;"></td>
                        <td align="center" style="width:80px;">操作</td>
                    </tr>
                    <asp:Repeater ID="rpContent" runat="server">
                        <ItemTemplate>
                            <tr   style="border:solid 1px #A2CBFF; height:20px;">
                                <td align="center"><%# Eval("consignee")%></td>
                                <td><%# Eval("province")%> &nbsp; <%# Eval("city")%>  &nbsp; <%# Eval("area")%> </td>
                                <td><%# Eval("address")%></td>
                                <td><%# Eval("postcode")%></td>
                                <td><%# Eval("phone")%></td>
                                <td><%# Eval("phone1")%></td>
                                <td align="center" style="color:#0000ff;"><%# Eval("isDefault").ToString()=="1"?"默认地址":"" %></td>
                                <td align="center"><a href='javascript:Edit(<%# Eval("addressID")%>);'>编辑</a> <a href='javascript:Delete(<%# Eval("addressID")%>);'>删除</a> </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </div>  
        </div>
    </div> 
    <div style="visibility:hidden">
        <asp:TextBox ID="txtID" runat="server"></asp:TextBox>&nbsp;
        <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click" />
    </div>
     <script type="text/javascript" language="javascript">
        function Edit(id)
        {
            window.location.href = "Member-Address-edit.aspx?addID=" + id;
        }
        function Delete(id)
        {
            document.getElementById("<%= this.txtID.ClientID %>").value=id;
            document.getElementById("<%= this.btnDelete.ClientID %>").click();
        }
     </script>
</asp:Content>

